﻿<Window x:Class="Docentric.Examples.Browser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		Icon="/Resources/docentric.ico"
        Title="Example Browser" Height="740" Width="985" ResizeMode="NoResize">


	<Grid>
		<Grid.Background>
			<ImageBrush ImageSource="/Resources/Background.jpg" Stretch="None" AlignmentX="Left" AlignmentY="Top" />
		</Grid.Background>

		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="200" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>

		<Grid.RowDefinitions>
			<RowDefinition Height="70" />
			<RowDefinition />
		</Grid.RowDefinitions>


		<!-- Banner -->
		<Canvas Grid.ColumnSpan="2" Height="100">
			<Image Canvas.Left="10" Canvas.Top="15" Source="/Resources/DocentricLogo.png" Width="200" />

			<Button Canvas.Right="10" Canvas.Top="10" Click="cmd_OpenSampleProjects_Click" ToolTip="Open Sample Projects." Cursor="Hand" Style="{StaticResource GlassButtonStyle}">
				<Image Source="/Resources/SampleProjects_48.png" Width="48" />
			</Button>
		</Canvas>


		<!-- List -->
		<GroupBox Grid.Row="1" Grid.Column="0" Header="Demos" Template="{StaticResource GroupBoxTemplate}" Margin="10,10,0,10">
			<GroupBox.Background>
				<ImageBrush ImageSource="/Resources/Background_Dark.jpg" Stretch="None" AlignmentX="Left" AlignmentY="Top" ViewboxUnits="Absolute" Viewbox="9,109,0,0" />
			</GroupBox.Background>
			
			<Grid>
				<Grid.Background>
					<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
						<GradientStop Offset="0.4" Color="#bbffffff" />
						<GradientStop Offset="0.8" Color="#00ffffff" />
					</LinearGradientBrush>
				</Grid.Background>

				<ItemsControl x:Name="ExampleItemsControl">
					<ItemsControl.ItemTemplate>
						<DataTemplate>
							<RadioButton Content="{Binding Path=Title}" Style="{StaticResource GraphicRadioButtonStyle}" GroupName="Examples" Checked="RadioButton_Checked" Cursor="Hand" Margin="1,2,1,0" />
						</DataTemplate>
					</ItemsControl.ItemTemplate>
				</ItemsControl>
			</Grid>
		</GroupBox>



		<!-- Welcome Content -->
		<ContentControl x:Name="cc_Welcome" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
			<Label Content="Welcome to Example Browser" FontSize="36" />
		</ContentControl>



		<!-- Demo Content -->
		<GroupBox x:Name="DemoContentGroupBox" Grid.Row="1" Grid.Column="1" Template="{StaticResource GroupBoxTemplate}" Visibility="Collapsed" Margin="10">
			<GroupBox.Header>
				<TextBlock Text="{Binding Title}" FontWeight="Medium" Foreground="White" />
			</GroupBox.Header>
			
			<GroupBox.Background>
				<ImageBrush ImageSource="/Resources/Background_Dark.jpg" Stretch="None" AlignmentX="Left" AlignmentY="Top" ViewboxUnits="Absolute" Viewbox="210,106,0,0" />
			</GroupBox.Background>

			<Grid>
				<Grid.Background>
					<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
						<GradientStop Offset="0.1" Color="#ddffffff" />
						<GradientStop Offset="0.4" Color="#bbffffff" />
						<GradientStop Offset="0.8" Color="#00ffffff" />
					</LinearGradientBrush>
				</Grid.Background>


				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto" />
						<RowDefinition Height="Auto" />
						<RowDefinition />
					</Grid.RowDefinitions>


					<!-- Description -->
					<Grid Grid.Row="0" Background="#cdddff">
						<Grid.ColumnDefinitions>
							<ColumnDefinition />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>

						<TextBlock Grid.Column="0" Text="{Binding Description}" Margin="10" FontSize="13" TextWrapping="Wrap" />

						<Button Grid.Column="1" x:Name="cmd_ExampleInHelp" Click="cmd_ExampleInHelp_Click" Margin="10" Cursor="Hand" VerticalAlignment="Top" ToolTip="Show this example in the help."
								Style="{StaticResource GlassButtonStyle}">
							<Image Source="/Resources/Help_32.png" Width="32" />
						</Button>
					</Grid>


					<!-- Diagram -->
					<Grid Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>

						<StackPanel Grid.Column="0" Margin="20">
							<TextBlock Text="Report Template:" HorizontalAlignment="Left" FontSize="16" />
							<Button Width="250" Height="250" Cursor="Hand" Click="ButtonReportTemplate_Click" ToolTip="Click to open" Style="{StaticResource GlassButtonStyle}">
								<Image Source="{Binding TemplateImageSource}" Margin="6" />

								<Button.RenderTransform>
									<ScaleTransform x:Name="st1" CenterX="125" CenterY="125" ScaleX="1" ScaleY="1" />
								</Button.RenderTransform>

								<Button.Triggers>
									<EventTrigger RoutedEvent="Button.MouseEnter">
										<BeginStoryboard>
											<Storyboard Storyboard.TargetName="st1">
												<DoubleAnimation Storyboard.TargetProperty="ScaleX" Duration="0:0:0.1" To="1.05" />
												<DoubleAnimation Storyboard.TargetProperty="ScaleY" Duration="0:0:0.1" To="1.05" />
											</Storyboard>
										</BeginStoryboard>
									</EventTrigger>
									<EventTrigger RoutedEvent="Button.MouseLeave">
										<BeginStoryboard>
											<Storyboard Storyboard.TargetName="st1">
												<DoubleAnimation Storyboard.TargetProperty="ScaleX" Duration="0:0:0.1" To="1" />
												<DoubleAnimation Storyboard.TargetProperty="ScaleY" Duration="0:0:0.1" To="1" />
											</Storyboard>
										</BeginStoryboard>
									</EventTrigger>
								</Button.Triggers>
							</Button>
						</StackPanel>

						<Image Grid.Column="1" Source="/Resources/ArrowRight_256.png" Width="150" Margin="25,0,25,0" Opacity="0.4" />

						<StackPanel Grid.Column="2" Margin="20">
							<TextBlock Text="Generated Report:" HorizontalAlignment="Left" FontSize="16" />
							<Button Width="250" Height="250" Cursor="Hand" Click="ButtonGenerateReport_Click" ToolTip="Click to generate" Style="{StaticResource GlassButtonStyle}">
								<Image Source="{Binding ReportImageSource}" Margin="6" />

								<Button.RenderTransform>
									<ScaleTransform x:Name="st2" CenterX="125" CenterY="125" ScaleX="1" ScaleY="1" />
								</Button.RenderTransform>

								<Button.Triggers>
									<EventTrigger RoutedEvent="Button.MouseEnter">
										<BeginStoryboard>
											<Storyboard Storyboard.TargetName="st2">
												<DoubleAnimation Storyboard.TargetProperty="ScaleX" Duration="0:0:0.1" To="1.05" />
												<DoubleAnimation Storyboard.TargetProperty="ScaleY" Duration="0:0:0.1" To="1.05" />
											</Storyboard>
										</BeginStoryboard>
									</EventTrigger>
									<EventTrigger RoutedEvent="Button.MouseLeave">
										<BeginStoryboard>
											<Storyboard Storyboard.TargetName="st2">
												<DoubleAnimation Storyboard.TargetProperty="ScaleX" Duration="0:0:0.1" To="1" />
												<DoubleAnimation Storyboard.TargetProperty="ScaleY" Duration="0:0:0.1" To="1" />
											</Storyboard>
										</BeginStoryboard>
									</EventTrigger>
								</Button.Triggers>
							</Button>
						</StackPanel>
					</Grid>


					<!-- C# Code -->
					<Grid Grid.Row="2">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition />
						</Grid.RowDefinitions>

						<TextBlock Grid.Row="0" Text="C# Code:" HorizontalAlignment="Left" Margin="10,0,0,0" FontSize="16" />
						<RichTextBox Grid.Row="1" x:Name="rtb_Code" Margin="10,5,10,10" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
							<FlowDocument x:Name="fd_Code" PageWidth="2500"></FlowDocument>
						</RichTextBox>
					</Grid>
				</Grid>
			</Grid>
		</GroupBox>
	</Grid>
</Window>
